<?php
	//Doi tuong NOTE se tao cho ban mot NOTE bat ky
	class Note {
		var $idkey = ""; //ID cua NOTE neu co
		var $title = ""; //Tieu de hien thi tren NOTE
		var $action = ""; //Link toi trang tuong ung
		var $level = 0; //La cap cua NOTE
		var $classname = ""; //Chua class trinh bay cho NOTE

		//Constructor Note
		function Note() {
		}
		//Dat ID cho doi tuong Note
		function setIdkey($newkey) {
			$this->idkey = $newkey;
		}
		//Dat tieu de cho doi tuong Note
		function setTitle($newtitle) {
			$this->title = $newtitle;
		}
		//Dat link cho doi tuong Note
		function setAction($newaction) {
			$this->action = $newaction;
		}
		//Dat cap the hien cua Note
		function setLevel($newlevel) {
			$this->level = $newlevel;
		}
		//Dat class trinh bay cho doi tuong lop.
		function setClassName($newclass) {
			$this->classname = $newclass;
		}
		//Dat thong tin cho mot doi tuong Note
		function setItem($nTitle, $nAction, $nLevel, $nClass, $nKey) {
			$this->title = $nTitle; // Tieu de Note
			$this->action = $nAction; //Link cua Note
			$this->level = $nLevel; //Cap cua Note
			$this->classname = $nClass; //Class trinh bay Note
			$this->idkey = $nKey; //ID cua Note
		}
		//Ham nay tao ra Note theo yeu cau cua ban va tra ve Note do neu thuc hien thanh cong, neu khong thanh cong tra ve null.
		function getNote() {
			$result = "";
			if($this->title != "") {
				$subject = "";
				$dem = $this->level;
				$total= "50" * $dem;
				//$tmp_bot = "";
				/*for($ii = 0; $ii < $this->level; $ii++) {
					if($tmp_top != "")
						$tmp_bot .= "<li class='smLine'><img src=\"images/sitemap/spacer.gif\" border=0 width=1 height=1></li>";
					$tmp_top .= "<li class='smLine'><img src=\"images/sitemap/spacer.gif\" border=0 width=1 height=10></li>";
				}*/
				//$subject .= "<div>" . $tmp_top . "</div>"; . $tmp_bot;  . $this->level . 
				$subject .= "<div id='sitemap_row' style='padding-left:".$total."px'>";
				$subject .= "<img src=\"images/sitemap/sm_arrow.gif\"><div class='txt'>[subject]</div>";
				$subject .= "</div>";
				$tmp = $this->title;
				if($this->action != "")
					$tmp = "<a class=table href=\"" . $this->action . $this->idkey . "\">" . $this->title . "</a>";
				$result = str_replace("[subject]", $tmp, $subject);
			}
			return $result;
		}
	}
?>